package app.fugema.shop.main.login.model;

import com.base.common.view.adapter.bean.ChildBaseBean;

import androidx.databinding.Bindable;


import java.math.BigDecimal;
import java.math.RoundingMode;

public class OauthInfoBean extends ChildBaseBean
{
    private String oauthType;
    private String oauthopenId;
    private String oauthnickname;
    private String headimgurl;
    private String unionid;
    private String province;
    private String city;
    private int sex;

    public String getOauthType() {
        return oauthType;
    }

    public void setOauthType(String oauthType) {
        this.oauthType = oauthType;
    }

    public String getOauthopenId() {
        return oauthopenId;
    }

    public void setOauthopenId(String oauthopenId) {
        this.oauthopenId = oauthopenId;
    }

    public String getOauthnickname() {
        return oauthnickname;
    }

    public void setOauthnickname(String oauthnickname) {
        this.oauthnickname = oauthnickname;
    }

    public String getHeadimgurl() {
        return headimgurl;
    }

    public void setHeadimgurl(String headimgurl) {
        this.headimgurl = headimgurl;
    }

    public String getUnionid() {
        return unionid;
    }

    public void setUnionid(String unionid) {
        this.unionid = unionid;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    @Bindable
    public String getLikeCountStr() {
        int likeNumber = 9995;
        if (likeNumber < 10000) {
            return String.valueOf(likeNumber);
        } else {
            return BigDecimal.valueOf(likeNumber)
                    .divide(BigDecimal.valueOf(10000))
                    .setScale(1, RoundingMode.HALF_UP)
                    .stripTrailingZeros().toPlainString() + "万";
        }
    }

    public String getTimesText()
    {
        int times = 4521452;
        int mm = times / 60;
        int ss = times % 60;
        String s1 = String.valueOf(mm);
        String s2 = String.valueOf(ss);
        if (mm < 10) {
            s1 = "0" + mm;
        } else {
            if (mm > 99) {
                int hh = mm / 60;
                int mms = mm % 60;
                s1 = hh + ":" + mms;
                if (mms < 10) {
                    s1 = hh + ":0" + mms;
                }
            }
        }
        if (ss < 10) {
            s2 = "0" + ss;
        }
        return s1 + ":" + s2;
    }
}
